#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
    string s;
    cin>>s;
    int len=s.size();
    ll x=0,y=0;
    ll sum=0;
    int flag=1;
    for(int i=0;i<len;i++){
        if(flag==1&&s[i]>='0'&&s[i]<='9'){
            x=x*10+(s[i]-'0');
        }
        else if(s[i]=='d') flag=2;
        else if(flag==2&&s[i]!='+'){
            y=y*10+(s[i]-'0');
        }
        else if(s[i]=='+') {
            if(y==0) sum+=(x*2);
            else sum=sum+x*(y+1);
            x=0;y=0;
            flag=1;
            //cout<<"sum  "<<sum<<endl;
        }
    }
        if(y==0) sum+=(x*2);
        else sum=sum+x*(y+1);
        if(sum&1)
        cout<<sum/2<<".5"<<endl;
        else cout<<sum/2<<endl;
    return 0;
}
